Mobile electronic devices such as personal digital assistants (PDAs) and digital cellular telephones are increasingly including applications written in the Java™ programming language. Many of these mobile devices include operating systems written in programming languages other than Java. To increase system stability, it would be desirable to implement all or part of the operating system, such as a high-level thread scheduler or interrupt handlers, using the Java programming language.
A thread may be generically defined as an independent flow of control or stream of execution within an executing application. A thread may include a context (e.g., a program counter and a register set) and an instruction sequence that can be executed independently of other instruction sequences. The Java programming language specification provides a thread API, java.lang.Thread, that may be used to implement multiple threads of execution within a Java program, and imposes a minimum priority-based thread scheduling policy on implementations of the Java Virtual Machine (“JVM”). In many JVM implementations, Java threads are implemented on the native threading model of a non-Java operating system and the scheduler of the operating system controls the scheduling of the Java threads.
In addition, the concept of an interrupt is not supported the Java programming language and standard JVM implementations. Some implementations provide non-standard native application program interfaces (“APIs”) to the interrupt handling capabilities of an underlying non-Java operating system. Enhancements to permit thread schedulers and interrupt handling to be implemented in the Java programming language are desirable.